<?php

namespace App\Http\Controllers\API\User;

use App\Http\Controllers\Controller;
use App\Http\Resources\UserInfoResource;
use App\Models\Student;
use App\Models\User;
use App\Services\UserService;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;

/**
 * Class UserController
 * @package App\Http\Controllers\API\User
 */
class UserController extends Controller
{
    /**
     * @var UserService
     */
    protected $userService;

    protected $mergeService;

    /**
     * UserController constructor.
     * @param UserService $userService
     */
    public function __construct(UserService $userService)
    {
        $this->userService = $userService;
    }

    /**
     * 获取用户信息
     *
     * @return UserInfoResource
     */
    public function show()
    {
        $student = User::with('student')->where('id',Auth::id())->first();
        return new UserInfoResource($student);
    }
}
